<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

//权限
var auth={
	cookieId:"auth",
	//获取集合地址
	url:$path+"/mc/authshowList",
	//是否自动加载
	autoload:true,
	//选项卡头信息
	//title:"测试2",
	//详细信息页面头信息
	infoTitle:"权限管理",
	//是否显示多选
	showchecked:true,
	//功能菜单
	buttons:[
		{name:'添加', bclass:'btnadd',onpress:showInfo,params:{iframe:true, dialogId: '#authDiv'}},
		{separator:true},
		{name:'编辑', bclass:'btnedit',onpress:showInfo,params:{check:true,iframe:true, dialogId: '#authDiv'}},
		{separator:true},
		{name:'禁用', bclass:'btndel',onpress:deleteInfo, params:{url: '/mc/authdisableEntity', info: '您确定要禁用选中的权限吗？'}},
		{separator:true},
		{name:'恢复', bclass:'btnCancelDelete',onpress:deleteInfo, params:{url: '/mc/authableEntity', info: '您确定要恢复选中的权限吗？'}},
		{separator:true}
	],
	//定义显示列名称
	colModel:[
		/*{display:'父模块',name:'parentName',sortable:true,sortName:'parentId',width:80},*/
		{display:'模块',name:'moduleName',sortable:true,sortName:'moduleId',width:80},
		{display:'权限名称',name:'keyName',sortable:true,width:180},
		{display:'权限显示名称',name:'funcName',sortable:true,width:180},
		{display:'创建时间',name:'createTime',sortable:true,width:120},
		{display:'是否操作按钮',name:'isOpDesc',sortable:true,sortName:'isOp',width:80},
		{display:'禁用状态',name:'delFlagDesc',sortable:true,sortName:'delFlag',width:60}
	],
	//是否使用分页
	usepager: true,
	//默认排序属性
	sortname: "moduleId,createTime",
	//默认排序规则
	sortorder: "asc,desc",
	//每页显示记录数
	//rp: 30,
	//procmsg:'加载中, 请稍等 ...',
	//pagestat: '显示记录从{from}到{to}，总数 {total} 条',
	//是否显示收缩按钮
	showTableToggleBtn: false,
	//删除请求提交地址
	delAction:'/mc/authdelInfo',
	//自定义查询节点id
	searchDiv:'#authSearchDiv',
	//显示详细信息页面 action 提交显示地址 modulePath 显示详细信息页面地址
	showAction:'/mc/common/showInfo.jsp?action=/mc/authshowInfo&modulePath=/mc/permission/auth',
	//列表双击操作 call 回调函数 params 请求附加参数
	onselect:{call:showInfo,params:{iframe:true, dialogId: '#authDiv'}}
};

//角色
var role={
	cookieId:"role",
	//获取集合地址
	url:$path+"/mc/roleshowList",
	//是否自动加载
	autoload:true,
	//选项卡头信息
	//title:"测试2",
	//详细信息页面头信息
	infoTitle:"角色管理",
	//是否显示多选
	showchecked:true,
	//功能菜单
	buttons:[
		{name:'添加', bclass:'btnadd',onpress:showInfo,params:{iframe:true, dialogId: '#roleDiv', paramData:{detailTblId: 'tblDetailAuth', detailModule: 'detailAuth'}}},
		{separator:true},
		{name:'编辑', bclass:'btnedit',onpress:showInfo,params:{check:true, dialogId: '#roleDiv', iframe:true, paramData:{detailTblId: 'tblDetailAuth', detailModule: 'detailAuth'}}},
		{separator:true},
		{name:'禁用', bclass:'btndel',onpress:deleteInfo, params:{url: '/mc/roledisableEntity', info: '您确定要禁用选中的角色吗？'}},
		{separator:true},
		{name:'恢复', bclass:'btnCancelDelete',onpress:deleteInfo, params:{url: '/mc/roleableEntity', info: '您确定要恢复选中的角色吗？'}},
		{separator:true}
	],
	//定义显示列名称
	colModel:[
		{display:'角色名称',name:'name',sortable:true,width:180},
		{display:'创建时间',name:'createTime',sortable:true,width:120},
		{display:'禁用状态',name:'delFlagDesc',sortable:true,sortName:'delFlag',width:60}
	],
	//是否使用分页
	usepager: true,
	//默认排序属性
	sortname: "createTime",
	//默认排序规则
	sortorder: "desc",
	//每页显示记录数
	//rp: 30,
	//procmsg:'加载中, 请稍等 ...',
	//pagestat: '显示记录从{from}到{to}，总数 {total} 条',
	//是否显示收缩按钮
	showTableToggleBtn: false,
	//删除请求提交地址
	delAction:'/mc/roledelInfo',
	//自定义查询节点id
	searchDiv:'#roleSearchDiv',
	//显示详细信息页面 action 提交显示地址 modulePath 显示详细信息页面地址
	showAction:'/mc/common/showInfo.jsp?action=/mc/roleshowInfo&modulePath=/mc/permission/role',
	//列表双击操作 call 回调函数 params 请求附加参数
	onselect:{call:showInfo, params:{iframe:true, dialogId: '#roleDiv', paramData:{detailTblId: 'tblDetailAuth', detailModule: 'detailAuth'}}}
};

//角色管理信息页面权限设置
var detailAuth = {};
$.extend(detailAuth, auth, {
	cookieId:"detailAuth", 
	//获取集合地址
	url:$path+"/mc/authshowListWithoutPager",
	//功能菜单
	buttons:[
		/*{name:'选择排序', bclass:'btnchanger',onpress:showOrder},
		{separator:true}*/
	],
	//定义显示列名称
	colModel:[
		/*{display:'父模块',name:'parentName',sortable:true,sortName:'parentId',width:80},*/
		{display:'模块',name:'moduleName',sortable:true,sortName:'moduleId',width:80},
		{display:'权限显示名称',name:'funcName',sortable:true,width:180},
		{display:'创建时间',name:'createTime',sortable:true,width:120},
		{display:'是否操作按钮',name:'isOpDesc',sortable:true,sortName:'isOp',width:80}
	],
	onselect: false, //屏蔽双击事件
	useSearch: false, //不使用搜索层
	usepager: false, //不显示分页工具栏
	useBtn:false, //屏蔽操作按钮
	mixValHid: '#hidAuthIdStr'
});

//操作员管理信息页面角色设置
var detailRole = {};
$.extend(detailRole, role, {
	cookieId:"detailRole",
	//获取集合地址
	url:$path+"/mc/roleshowListWithoutPager",
	title: "<label style='color:#F80;'>温馨提示：双击可显示角色的权限列表的哦(*^__^*)</label>",
	//功能菜单
	buttons:[
	         
	],
	//定义显示列名称
	colModel:[
		{display:'角色名称',name:'name',sortable:true,width:80},
		{display:'创建时间',name:'createTime',sortable:true,width:120}
	],
	//列表双击操作 call 回调函数 params 请求附加参数
	onselect:{call:window.parent.showInfo, params:{iframe:true, dialogId: '#roleDiv', isHideBtn: true, paramData:{detailTblId: 'tblDetailAuth', detailModule: 'detailAuth'}}},
	useSearch: false, //不使用搜索层
	useBtn: false,
	usepager: false, //不显示分页工具栏
	onSubmit: function(gDiv, t, p) {
		var isAdmin = $(".detail #hidIsAdmin").val();
		//如果是超级管理，隐藏角色选择列表
		if(isAdmin === "1") {
			$(gDiv).hide();
		}
		return true;
	},
	mixValHid: '#hidRoleIdStr'
});